"use strict";(self.webpackChunkwebpack_frontend=self.webpackChunkwebpack_frontend||[]).push([[3076,897],{47224:(e,t,n)=>{n.r(t),n.d(t,{default:()=>m});n(28706),n(52675),n(89463),n(2259),n(45700),n(74423),n(23792),n(48598),n(62062),n(89572),n(2892),n(84185),n(26099),n(21699),n(47764),n(62953);var o=n(61219),s=n(57356),r=n(80897);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function a(e,t){for(var n=0;n').concat(n+" ("+t+")","\n ")})).join("")}}],(t=[{key:"_attachEvents",value:function(){var e=this;document.querySelector("[data-send-form]").addEventListener("click",(function(t){t.preventDefault();var n=e.CustomSelect.selectedItemValue;s.C.sendData({token:e.token,currency:n,redirectUri:e.redirectUri})}))}}])&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}();var u=n(69162);const d={hash:"#popup-currency-choice",url:"",handler:function(e){!function(e){new l(e)}({token:u.A._getSearchParam("token"),redirectUri:u.A._getSearchParam("redirect_uri")}),e&&e()}};var h=n(84634);d.html=(0,h.Im)(window.registrationCurrenciesList)||window.registrationCurrenciesList<=1?"":'');const m=d},63076:(e,t,n)=>{n.d(t,{A:()=>M});const o=n(62555).A;var s=n(15783),r=(n(23792),n(26099),n(3362),n(27495),n(47764),n(5746),n(62953),n(52675),n(89463),n(2259),n(45700),n(28706),n(2008),n(51629),n(89572),n(94170),n(62010),n(2892),n(59904),n(84185),n(40875),n(10287),n(9391),n(60825),n(84864),n(38781),n(25440),n(23500),n(1598)),i=n(3223),a=n(10245),c=n(84634),l=n(33333);function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function d(e,t){for(var n=0;n0&&void 0!==arguments[0])||arguments[0];this.commonInstance.form.classList.add("hide"),this.commonInstance.showBlockHelper("message","phone-info"),this.formConfirmSmsCode.classList.remove("hide"),this.formConfirmSmsCode.querySelector('input[type="hidden"]').value=this.value,this.FormFieldAction=new f.A(this.formConfirmSmsCode),this._attachSmsCodeEvent()._initReSendSmsCode(),e?(this.commonInstance.showBlockHelper("footer","sms-resend-block"),this._secondsTimer.start()):this.commonInstance.hidePopupFooter()}},{key:"_attachSmsCodeEvent",value:function(){var e=this;return this.formConfirmSmsCode.addEventListener("submit",(function(t){t.preventDefault();var n={phone:e.value,verifyCode:e.field.value};(0,v.Q_)(e.submitButton),e._validateSmsCode()&&e._checkSmsCode(n).then((function(t){var n,o=t.data;if(null!==(n=o.userCheckResetPasswordPhone)&&void 0!==n&&n.success){var s=(0,c.LO)("newpass");window.location.href=(0,c.cV)({search:"token=".concat(o.userCheckResetPasswordPhone.token).concat(s)})}else i.A.addErrorToElement(e.field,e.field.dataset.errorMessage)})).catch((function(t){!(0,c.KV)()&&console.log(t),e._errorHandler(t.graphQLErrors[0])})).then((function(){return(0,v.Dv)(e.submitButton)}))})),this.field.addEventListener("input",(function(t){t.preventDefault(),e.field.value.length>=4?e.submitButton.classList.add("valid"):e.submitButton.classList.remove("valid")})),this}},{key:"_initReSendSmsCode",value:function(){var e=this;return this.resendSmsCodeButtons.length&&this.resendSmsCodeButtons.forEach((function(t){t.addEventListener("click",(function(n){e.wasResendFromFooter=Boolean(t.closest('[data-restore-password-sms="resend"]')),n.preventDefault();var o={phone:e.value};e._resendSmsCodeToUser(o)}))})),this}},{key:"_errorHandler",value:function(e){var t=e.code,n=e.message;"no_attempts"===t?(this.formConfirmSmsCode.classList.add("hide"),this.commonInstance.hidePopupFooter(),this.codeRequestAttempts?this.commonInstance.showBlockHelper("message","wrong-sms-code"):this._showStepChat()):i.A.addErrorToElement(this.field,n)}},{key:"_checkSmsCode",value:function(e){return(0,a.A)().mutate({mutation:(0,a.$)("userCheckResetPasswordPhone"),variables:e,fetchPolicy:"no-cache"})}},{key:"_validateSmsCode",value:function(){var e=this.field.value;return 0!==e.length&&!isNaN(Number(e))||(i.A.addErrorToElement(this.field,this.field.dataset.errorMessage),!1)}},{key:"_showStepChat",value:function(){this.commonInstance.showBlockHelper("message","no-attempts"),this.commonInstance.hidePopupFooter(),this.commonInstance.form.classList.add("hide"),this.formConfirmSmsCode.classList.add("hide")}}],t&&S(e.prototype,t),n&&S(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,n}(),C=n(30200);function g(e){return(0,a.A)().mutate({mutation:(0,a.$)("userSendResetPasswordEmail"),variables:e,fetchPolicy:"no-cache"})}function E(e){return(0,a.A)().mutate({mutation:(0,a.$)("userResetPasswordByPhoneSend"),variables:e,fetchPolicy:"no-cache"})}var _=n(53390),P=n(74692);function A(e){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(e)}function L(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function R(e,t){for(var n=0;n".concat(t,""))}}},{key:"_errorHandler",value:function(e,t,n){if("object"===A(e)&&e.hasOwnProperty("code")){var o=e.code,s=e.message;"no_attempts"!==o?i.A.addErrorToElement(t,s):this._showStepSection("email"!==n&&this.smsCodeRequestAttempts?"wrong-code":"no-attempts")}else console.error(e)}},{key:"_getPhoneValue",value:function(){return C.Ay.getFullPhoneNumber(this.phone)}},{key:"_attachEvents",value:function(){var e=this;new f.A(this.form),this.form.addEventListener("submit",(function(t){t.preventDefault();var n=e.isPhoneTabSelected(e.state.mutationType);e.field=n?e.phone:e.email;var o=e.field.value;((0,v.Q_)(e.submitButton),n)?e._validatePhone(o)&&E({phone:e._getPhoneValue(o)}).then((function(t){var n=t.data.userResetPasswordByPhoneSend,o=n.success,s=n.codeRequestAttempts,r=n.channel;e.smsCodeRequestAttempts=Boolean(+s),o?e._successSendPhone(r):e._showStepSection("no-attempts")})).catch((function(t){e._errorHandler(t.graphQLErrors[0],e.field,"phone"),!(0,c.KV)()&&console.log(t)})):e._validateEmail(o)&&g({email:o}).then((function(t){t&&e._successSendEmail()})).catch((function(t){e._errorHandler(t.graphQLErrors[0],e.field,"email"),!(0,c.KV)()&&console.log(t)}))})),document.addEventListener(_.A.AUTH_TABS_TRIGGER,(function(t){e.state.mutationType=e.mutationTypes[t.detail.activeTab],e.changeActiveInputField(e.state.mutationType)}))}},{key:"_validateEmail",value:function(e){if(!r.A.isCorrectEmail(e)||""===e){var t=""===e?(0,l.A)("empty-field"):(0,l.A)("enter-correct-email");return i.A.addErrorToElement(this.field,t),!1}return!0}},{key:"_validatePhone",value:function(e){var t="",n="phone"===this.field.dataset.name;return e.replace(/[^\d]/g,"").length<8?t=(0,l.A)(n?"incorrect-number":"wrong-email-or-phone"):/^[a-zа-яё]+/i.test(e)||""===e?t=(0,l.A)(""===e?"empty-field":"wrong-email-or-phone"):n&&new r.A(this.form).isRepeatedCountryCode(this.field)&&(t=(0,l.A)("repeated-country-code")),!t||(i.A.addErrorToElement(this.field,t),!1)}},{key:"_successSendEmail",value:function(){var e=this._showStepSection("send-email");this._insertUserInfo(e,this.field.value),this._attachResendEmailEvent()}},{key:"_successSendPhone",value:function(e){e||(e="SMS"),this._showStepSection("confirmation").dataset.restoreStepConfirmation=e.toLowerCase(),new j(this)._attachEvents()}},{key:"_resendEmail",value:function(){var e=this;g({email:this.field.value}).then((function(t){t.data.userSendResetPasswordEmail&&e._showStepSection("repeat-email")})).catch((function(t){e._errorHandler(t.graphQLErrors[0],e.field,"email"),!(0,c.KV)()&&console.log(t)}))}},{key:"_attachResendEmailEvent",value:function(){var e=this;this.resendEmailButton.forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault(),e._resendEmail()}),{once:!0})}))}},{key:"_containsAlias",value:function(e,t){var n=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:document).querySelectorAll(e);return Array.prototype.filter.call(n,(function(e){return RegExp(t).test(e.textContent)}))}}])}(_.A),j=function(){return I((function e(t){var n=this;L(this,e),this.instance=t,this.popup=this.instance.popup,this.form=this.popup.querySelector("#restore-password-confirmation-form"),this.field=this.form.querySelector("#sms-code-input"),this.submitButton=this.form.querySelector('[type="submit"]'),this.resendPhoneFooter=this.popup.querySelector("[data-restore-resend]"),this.resendPhoneButton=this.instance.resendPhoneButton,this.smsCodeRequestAttempts=this.instance.smsCodeRequestAttempts,this.smsCodeRequestAttempts&&(this.timerOpt={sec:59,callback:function(){return n.instance._timerCallback()}},this._secondsTimer=new p.$(this.timerOpt))}),[{key:"_attachEvents",value:function(){var e=this;this.FormFieldAction=new f.A(this.form),this.smsCodeRequestAttempts?this._secondsTimer.start():this.resendPhoneFooter.classList.add(this.instance.hiddenClassName),this.form.addEventListener("submit",(function(t){t.preventDefault(),(0,v.Q_)(e.submitButton);var n={phone:e.instance._getPhoneValue(),verifyCode:e.field.value};e._validateCode()&&function(e){return(0,a.A)().mutate({mutation:(0,a.$)("userCheckResetPasswordPhone"),variables:e,fetchPolicy:"no-cache"})}(n).then((function(t){var n,o=t.data;if(null!==(n=o.userCheckResetPasswordPhone)&&void 0!==n&&n.success){var s=(0,c.LO)("newpass");window.location.href=(0,c.cV)({search:"token=".concat(o.userCheckResetPasswordPhone.token).concat(s)})}else i.A.addErrorToElement(e.field,e.field.dataset.errorMessage)})).catch((function(t){!(0,c.KV)()&&console.log(t),e.instance._errorHandler(t.graphQLErrors[0],e.field,"code")})).finally((function(){return(0,v.Dv)(e.submitButton)}))})),this.field.addEventListener("input",(function(t){t.preventDefault(),e.field.value.length>=4?e.submitButton.classList.remove("disabled"):e.submitButton.classList.add("disabled")})),this._attachResendPhoneEvent()}},{key:"_validateCode",value:function(){var e=this.field.value;return 0!==e.length&&!isNaN(Number(e))||(i.A.addErrorToElement(this.field,this.field.dataset.errorMessage),!1)}},{key:"_attachResendPhoneEvent",value:function(){var e=this;this.resendPhoneButton.forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault(),e._resendPhone()}),{once:!0})}))}},{key:"_resendPhone",value:function(){var e=this;E({phone:this.instance.field.value}).then((function(t){var n=t.data;if(null!=n&&n.userResetPasswordByPhoneSend){var o,s=n.userResetPasswordByPhoneSend,r=s.success,a=s.codeRequestAttempts;if(e.smsCodeRequestAttempts=Boolean(+a),!r)return e.instance._showStepSection("no-attempts"),!1;e.instance._isSectionActive("wrong-code")&&(e.instance._showStepSection("confirmation"),e._secondsTimer.reset()),e.smsCodeRequestAttempts?(e.instance._timerCallback(),e._secondsTimer.start()):e.resendPhoneFooter.classList.add(e.instance.hiddenClassName),null===(o=e.FormFieldAction)||void 0===o||o.fieldBlur(null,e.field),i.A.clearError(P(e.field))}}))}}])}(),F=function(e){function t(){var e;L(this,t),e=B(this,t,["#restore-password-form"]);var n=!!window.restorePassViaPhone;return e.popup=document.querySelector("#restore-password-popup-id"),e.email=e.form.querySelector("#user-contact-field"),e.phone=e.form.querySelector("#user-phone-field"),e.field=e.email,e.submitButton=e.form.querySelector('[type="submit"]'),e.ResetViaEmail=new m(e),e.ResetViaPhone=n&&new k(e),e.state={mutationType:e.form.dataset.mutationType||"email"},new f.A(e.form),e._attachEvents(),e}return O(t,e),I(t,[{key:"showBlockHelper",value:function(e,t){var n="restore-password-"+e,o=this.popup.querySelectorAll("[data-".concat(n,"]")),s=null;if(o.length)return o.forEach((function(e){e.getAttribute("data-".concat(n))===t?(e.classList.remove("hide"),s=e):e.classList.add("hide")})),s}},{key:"hideBlockHelper",value:function(e,t){var n,o="[data-restore-password-".concat(e,"=").concat(t);null===(n=this.popup.querySelector(o))||void 0===n||n.classList.add("hide")}},{key:"hidePopupFooter",value:function(){var e,t=document.querySelector(".popup"),n=t.querySelector(".popup-footer__redesign");return t.querySelectorAll("[data-restore-password-footer]").forEach((function(e){e.classList.add("hide")})),null===(e=t.querySelector(".popup-body"))||void 0===e||e.classList.remove("popup-dark"),null==n||n.classList.add("hide"),this}},{key:"errorHandler",value:function(e,t,n){if("object"===A(e)&&e.hasOwnProperty("code")){var o=e.code,s=e.message;if("no_attempts"===o)t.classList.add("hide"),this.hidePopupFooter().showBlockHelper("message","no-attempts");else i.A.addErrorToElement(n,s)}else console.error(e)}},{key:"_getPhoneValue",value:function(e){var t=(0,c.Ck)()?this.form.querySelector("[data-country-code]"):this.form.querySelector(".selected-dial-code");return"".concat(t?t.textContent:"").concat(e).replace(/[^\d+]/g,"")}},{key:"_attachEvents",value:function(){var e=this;return this.form.addEventListener("submit",(function(t){t.preventDefault();var n=e.isPhoneTabSelected(e.state.mutationType);e.field=n?e.phone:e.email;var o=e.field.value;if((0,v.Q_)(e.submitButton),n){if(e.ResetViaPhone.validate(o)){var s={phone:e._getPhoneValue(o)};e.ResetViaPhone.sendSmsCodeToUser(s)}}else if(e.ResetViaEmail.validate(o)){var r={email:o};e.ResetViaEmail.sendResetPassEmail(r).then((function(t){t&&e.ResetViaEmail.successHandler()})).catch((function(t){!(0,c.KV)()&&console.log(t),e.errorHandler(t.graphQLErrors[0],e.form,e.field)}))}})),document.addEventListener(_.A.AUTH_TABS_TRIGGER,(function(t){e.state.mutationType=e.mutationTypes[t.detail.activeTab],e.changeActiveInputField(e.state.mutationType)})),this}}])}(_.A);const U={hash:"#popup-forgot",url:window.location.search?"/resetting/request/".concat(window.location.search):"/resetting/request",handler:function(e){var t='[data-popup="header"] [data-lang-switcher-wrap]';(0,c.z1)(t).then((function(e){e&&n.e(956).then(n.bind(n,60956)).then((function(e){return e&&e.default(t)}))})),(0,c.zL)()?new V:new F,_.A.authorizationPopupsTabsHandler(),e&&e()}};var D=n(45081),x=n(74773),Q=n(70298),K=n(47224),$=n(995),z=n(89531);const M=[o,s.A,U,D.A,x.A,Q.A,K.default,$.A,z.A]},80897:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});n(52675),n(89463),n(2259),n(45700),n(51629),n(25276),n(23792),n(62062),n(89572),n(94170),n(2892),n(84185),n(26099),n(47764),n(23500),n(62953);var o=n(84634);function s(e){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s(e)}function r(e,t){for(var n=0;nt?this.itemsHeight-(n-t)-10:this.itemsHeight}},{key:"slideDown",value:function(){var e=this.calculateHeight();this.selectList.style.height="".concat(e,"px")}},{key:"slideUp",value:function(){this.selectList.style.height="".concat(this.selectItemHeight,"px")}},{key:"open",value:function(){this.select.classList.add("select-block--open"),this.slideDown(),this.selectButton.setAttribute("aria-expanded",!0),this.updateLive()}},{key:"close",value:function(){this.slideUp(),this.select.classList.remove("select-block--open"),this.selectButton.setAttribute("aria-expanded",!1),this.selectList.scrollTop=0}},{key:"handleItemClick",value:function(e){this.close(),this.setSelected(e.target),this.selectButton.focus(),this.isNeedToReturnValue&&(0,o.le)(document,"selectedValue",this.selectedItemValue)}},{key:"handleItems",value:function(e){var t=this.getActiveIndex();e===this.key.UP&&t>0&&(this.setActive(this.selectItems[t-1]),this.updateLive()),e===this.key.DOWN&&t